package com.standbyme.whitelistspringbootstarter.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnClass(WhiteListConfig.class)
@EnableConfigurationProperties(WhiteListConfig.class)
public class WhiteListAutoConfigure {

    @Bean
    @ConditionalOnMissingBean
    public String whitelistConfig(WhiteListConfig whiteListConfig) {
        return whiteListConfig.getValue();
    }
}
